function gcpick_writetonllocobs(data, config)
file = [ config.resultpath, '/' ,config.nllocName ];
fn = fopen(file, 'w');
for i=1:length(data)
    name = data(i).station;
    rt = data(i).reftime;
    tp = datetime(rt(1),1,1)+days(rt(2)-1)+hours(rt(3))+minutes(rt(4))...
        +seconds(rt(5)+data(i).tp)+milliseconds(rt(6));
    ts = datetime(rt(1),1,1)+days(rt(2)-1)+hours(rt(3))+minutes(rt(4))...
        +seconds(rt(5)+data(i).ts)+milliseconds(rt(6));
    if data(i).tp > 0
        fprintf(fn,'%s P %04d%02d%02d %02d%02d %.4f\n',name, tp.Year, tp.Month, ...
            tp.Day, tp.Hour, tp.Minute, tp.Second);
    %else
        % fprintf(fn,'%s P %04d%02d%02d %02d%02d %.4f\n',name, zeros(1,6)-1);
        % disp([config.infoIndent, name, ' Tp not picked.']);
    end
    if data(i).ts > 0
        fprintf(fn,'%s S %04d%02d%02d %02d%02d %.4f\n',name, ts.Year, ts.Month, ...
            ts.Day, ts.Hour, ts.Minute, ts.Second);
    %else
        % fprintf(fn,'%s S %04d%02d%02d %02d%02d %.4f\n',name, zeros(1,6)-1);
        % disp([config.infoIndent, name, ' Ts not picked.']);
    end
end
fclose(fn);
end